#include "main.h"
#include "AppTask.h"
#include "usartDriver.h"
#include "oledDriver.h"
#include "nrf24l01.h"
#include "Delay.h"

int main(void)
{
	uint8_t sendBuf[32] = { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66};
	uint8_t recvBuf[32] = { 0 };
	Sw_Nrf24L01Init();
	//FreeRtosStart();

	//Motor_SetSpeed(speed);
	//OLED_ShowSignedNum(1, 10, speed, 3);
	while (1) {
		if (Sw_ReadIRQ() == 0) {
	        Sw_RecvData(recvBuf);
	    }
	    OLED_ShowHexNum(1,1,recvBuf[0],2);
	    OLED_ShowHexNum(1,4,recvBuf[1],2);
	    OLED_ShowHexNum(2,1,recvBuf[2],2);
	    OLED_ShowHexNum(2,4,recvBuf[3],2);
	    OLED_ShowHexNum(3,1,recvBuf[4],2);
	    OLED_ShowHexNum(3,4,recvBuf[5],2);
	    Delay_ms(1000);
	    sendBuf[0] += 1;
		Sw_SendData(sendBuf);
	}
	return 0;
}
